import { createSlice } from '@reduxjs/toolkit'

const initialState = [
    {
        id:0,
        text:"Hello"
    },
    {
        id:1,
        text:"world"
    }
]

const todoListSlice = createSlice({
    name: "todoList",
    initialState,
    reducers: {
        addTodo(state, action) {
            state.push(action.payload)
        }
    }
})
export const { addTodo } = todoListSlice.actions;
export default todoListSlice.reducer;